/**
 * 添加文章js
 * date: 2010-12-9
 */
COMM.lib.load("form");
COMM.lib.load("dialog");
(function($){
	var addArticle = (function(){
		
		var categorysData,catTemp,dataMap,id,subData;

		var submitValue = function(){
			$.postForm({
				formId : "#articleForm",
				url: "/admin/article/add.do",
				success: function(data){
					if(data.result == 0){
						alert("添加失败！");
					} else {
						alert("添加成功！");
					}
				}
			});
		};
		var checkParameter = function(){
			return true;
		};
		return {
			check : function(){
				return checkParameter();
			},
			add : function(){
				submitValue();
			}
		};
	})();
	
	$(document).ready(function(){
		$("#aa-submit").click(function(){
			if(addArticle.check()){
				addArticle.add();
			}
		});
	});
})(jQuery);